//票类添加


$(".addBtn").on('click',function(){
        $(".first_li").show();
        var new_row = Number($(".listBox").attr("num"));
        var tpl = $("#ticket_temlate").html();
        new_ticket_tp = tpl.replace(/{num}/g, new_row),
        $("#listBox").find('ul').append(new_ticket_tp);
        var lt=$(".newLt").height();
        var rt=$(".newRt").height();
        var newLine=$(".newLine").height();
        var ltBox=$("#listBox").height();
        var rtBox=$("#data_list").height();
        console.log("  lt:"+lt+"  rt:"+rt+"  ltBox："+ltBox+"  rtBox:"+rtBox+" newLine:"+newLine);
        if(ltBox>rtBox){
            var rtHeight=lt+30;
            $(".newRt").css("height",rtHeight);
            $(".newLt").css("height",rtHeight);
        }

    });
   

//票类删除
$(".iconDel").live("click",function(e){
	var target = $(e.currentTarget);
	target.parent().remove();
        var lt=$(".newLt").height();
        var rt=$(".newRt").height();
        var newLine=$(".newLine").height();
        var ltBox=$("#listBox").height();
        var rtBox=$("#data_list").height();
        console.log("  lt:"+lt+"  rt:"+rt+"  ltBox："+ltBox+"  rtBox:"+rtBox+" newLine:"+newLine);
        if(ltBox>rtBox){
            var rtHeight=lt-30;
            $(".newRt").css("height",rtHeight);
             $(".newLt").css("height",rtHeight);
        }
       
 });


$(".txt_no_input").live("click",function(e){
	var target = $(e.currentTarget);
	console.log(target.attr("data"))
})


//门票添加	
$("#price_tb").on('click','.add_btn',function(){
		var ttype = "1",
        tbody = $("#data_list"),
        tpl = $("#template").html()
            .replace(/{price_control}/g,'<button class="listAddBtn"><i class="iconfont cude_btn" data="1">&#xe67a;</i></button>')
		tbody.append(tpl);
        var lt=$(".newLt").height();
        var rt=$(".newRt").height();
        var newLine=$(".newLine").height();
        var ltBox=$("#listBox").height();
        var rtBox=$("#data_list").height();
        console.log("  lt:"+lt+"  rt:"+rt+"  ltBox："+ltBox+"  rtBox:"+rtBox+" newLine:"+newLine);
        if(rtBox-ltBox>60){
            var rtHeight=rtBox+36;
            $(".newRt").css("height",rtHeight);
            $(".newLt").css("height",rtHeight);
        }
       
 
        
 });
	
	
	
//门票删除	

$(".cude_btn").live("click",function(e){
	var target = $(e.currentTarget);
	//target.parent().parent().parent().attr("tese","1");
	target.parent().parent().parent().remove();
        var lt=$(".newLt").height();
        var rt=$(".newRt").height();
        var newLine=$(".newLine").height();
        var ltBox=$("#listBox").height();
        var rtBox=$("#data_list").height();
        console.log("  lt:"+lt+"  rt:"+rt+"  ltBox："+ltBox+"  rtBox:"+rtBox+" newLine:"+newLine);
        if(rtBox>ltBox){
            var rtHeight=rtBox+36;
            $(".newRt").css("height",rtHeight);
            $(".newLt").css("height",rtHeight);
        }
       
		
 });

 
 